package PTA01;
import java.util.Scanner;
public class Text03 {
	public static void main(String[] args) {
		  Scanner in = new Scanner(System.in);
	        
	        while (in.hasNext()) {
	        	int num=0;
	        	String a = in.next();
	        	String str=a;  
	            char[] arry;  
                arry = str.toCharArray(); 
                for (int i = 0; i < a.length(); i++) {
                	 if(arry[i]!='-'&&arry[i]!='.')
                	 {
                		 num=num+arry[i]-48;
                	 }	
				}
                System.out.println(num);
	        }
	       
	}
}
